<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


/*************张健领************************/
//首页
Route::get('/', 'Home\IndexController@Index');
//商品列表
Route::get('/shoplist', 'Home\IndexController@List');
//详情页
Route::get('/detail/{gid}', 'Home\IndexController@Detail')->where('gid', '[0-9]+');

//结账页面
Route::get('/pay/{user_id}', 'Home\CartController@Pay');
//登录页
Route::get('/finallogin', 'Home\IndexController@Login');
//注册页
Route::get('/finalregister', 'Home\IndexController@Register');
Route::get('/register', 'Home\IndexController@Register');


// 商品详情页城市三级联动数据测试
Route::post('/shop/area/{upid?}' , 'Home\ShopController@Area');
Route::get('/area/{upid?}' , 'Home\ShopController@Area');

//商品详情页 商品属性ajax
Route::post('/shop/attr' , 'Home\ShopController@attrs');
Route::post('/shop/attrsearch' , 'Home\ShopController@attrSearch');
//导航栏分类搜索
Route::get('/type/{typeid}' , 'Home\ShopController@TypeSearch');

Route::post('/shop/type' , 'Home\ShopController@NextId');


// 加载支付成功页面
Route::get('/success', 'Home\IndexController@Success');


//意见反馈页(区汉东)
Route::get('/suggest', 'Home\IndexController@Suggest');
//处理意见反馈(区汉东)
Route::post('/dosuggest','Home\UserController@dosuggest');
Route::get('/doIndexSearch','Home\IndexController@searchInList');



/*****************end******************************/





/********************购物车******************************/
//购物车
Route::get('/cart', 'Home\CartController@index');
// 加入购物车
Route::post('/addCart', 'Home\CartController@addCart');
//改变购物车商品数量
Route::post('/changeNum', 'Home\CartController@changeNum');
// 删除购物车商品
Route::post('/deleteCart', 'Home\CartController@deleteCart');

/***********前台个人中心***********/
//个人中心首页
Route::get('/Home/personal', 'Home\PersonalController@personal');

//个人信息
Route::get('/Home/information', 'Home\PersonalController@information');

//个人信息修改
Route::post('/Home/inforModify', 'Home\PersonalController@inforModify');

//电话修改
Route::get('/Home/phoneRevise', 'Home\PersonalController@phoneRevise');

//邮箱修改
Route::get('/Home/emailRevise', 'Home\PersonalController@emailRevise');

//地址管理
Route::get('/Home/address', 'Home\PersonalController@address');

//添加地址
Route::post('/Home/addAddress', 'Home\PersonalController@addAddress');

//编辑地址
Route::get('/Home/modifyAddress/{id}', 'Home\PersonalController@modifyAddress')->where('id', '[0-9]+');

//执行修改地址
Route::post('/Home/editAddress', 'Home\PersonalController@editAddress');

//删除地址
Route::get('/Home/deleteAddress/{id}', 'Home\PersonalController@deleteAddress')->where('id', '[0-9]+');

//进入修改密码页面
Route::get('/Home/passChange', 'Home\PersonalController@passChange');

//判断旧密码是否正确
Route::post('/Home/oldPass', 'Home\PersonalController@oldPass');

//新密码验证
Route::post('/Home/newPass', 'Home\PersonalController@newPass');

//修改密码
Route::post('/Home/modify', 'Home\PersonalController@modify');

//订单管理
Route::get('/Home/order', 'Home\PersonalController@order');

// 确认支付
Route::get('/Home/pay/{id}', 'Home\PersonalController@pay')->where('id', '[0-9]+');

//确认收货
Route::get('/Home/receipt/{id}', 'Home\PersonalController@receipt')->where('id', '[0-9]+');

// [范泽铠]取消订单
Route::get('/Home/delete/{id}', 'Home\PersonalController@delete');

//取消订单
Route::get('/Home/cancel/{id}', 'Home\PersonalController@cancel')->where('id', '[0-9]+');

//订单详情
Route::get('/Home/orderDetail', 'Home\PersonalController@orderDetail');

//商品评论
Route::get('/Home/comment', 'Home\PersonalController@comment');

//退款售后
Route::get('/Home/refund', 'Home\PersonalController@refund');


//进入商品评论页
Route::get('/Home/refund', 'Home\PersonalController@refund');

//执行商品评论
Route::post('/Home/evaluateGoods', 'Home\PersonalController@evaluateGoods');

//我的积分
Route::get('/Home/integral', 'Home\PersonalController@integral');


//积分商城
Route::get('/Home/integralGoods', 'Home\PersonalController@integralGoods');

//兑换积分商品地址
Route::get('/Home/exchangeAddress/{id}', 'Home\PersonalController@exchangeAddress')->where('id', '[0-9]+');

//积分订单添加地址
Route::post('/Home/appendAddress', 'Home\PersonalController@appendAddress');

//提交积分订单deleteIntAddress
Route::post('/Home/submitIntegralOrder', 'Home\PersonalController@submitIntegralOrder');

//删除积分定单地址
Route::get('/Home/deleteIntAddress/{id}', 'Home\PersonalController@deleteIntAddress')->where('id', '[0-9]+');

//积分详情
Route::get('/Home/integralList', 'Home\PersonalController@integralList');

//积分商品定单
Route::get('/Home/integralOrder', 'Home\PersonalController@integralOrder');

//积分订单收货
Route::get('/Home/saidIntegral/{id}', 'Home\PersonalController@saidIntegral')->where('id', '[0-9]+');

//积分订单删除
Route::get('/Home/deleteIntOrder/{id}', 'Home\PersonalController@deleteIntOrder')->where('id', '[0-9]+');

//收藏
Route::get('/Home/collection', 'Home\PersonalController@collection');

//取消收藏
Route::get('/Home/cancelCollection/{id}', 'Home\PersonalController@cancelCollection')->where('id', '[0-9]+');


/************************个人中心完成************************/


/************************前台注册************************/
//Home(前台注册)有问题找区汉东
//处理注册的路由
//用户名验证
Route::post('/user/name','Home\UserController@nameManage');

// 密码验证
Route::post('/user/pass','Home\UserController@passManage');

// 手机验证
Route::post('/user/phone','Home\UserController@phoneManage');

// 邮箱验证
Route::post('/user/email','Home\UserController@emailManage');

// 验证码验证
Route::post('/docode','Api\Common@sendPhoneMsg');
Route::post('/user/code','Home\UserController@codeManage');

// 注册总验证
Route::post('/doregister','Home\UserController@handerRegister');

//手机验证码
Route::get('/send/{phone}/{code}','Api\Common@sendPhoneMsg');

/************************前台注册完成************************/

/***********前台登录模块***********/
//Home(前台登录的路由)
Route::post('/dologin','Home\UserController@handerLogin');

//登录验证码路由
Route::get('/makecode','Api\Common@buildCode');

//邮箱发送路由
Route::get('/password/reset', function () {
	return view('password/reset');
});


//注销登录并返回首页
Route::get('/logout', 'Home\UserController@logout');

/***********前台登录模块完成***********/




//Admin


/***********后台登录模块***********/
//加载登录页面
Route::get('/admin/login', 'Admin\LoginController@login');
//登录处理
Route::post('/admin/doLogin', 'Admin\LoginController@doLogin');
//注销
Route::get('/admin/logout', 'Admin\LoginController@logout')->middleware('adminSession');

/***********后台主页模块***********/
//加载后台主页
Route::get('/admin/', 'Admin\IndexController@index')->middleware('adminSession');
//头部
Route::get('/admin/Index/head', 'Admin\IndexController@head')->middleware('adminSession');
//主页
Route::get('/admin/Index/main', 'Admin\IndexController@main')->middleware('adminSession');
//侧面菜单
Route::get('/admin/Index/nav', 'Admin\IndexController@nav')->middleware('adminSession');
//底部
Route::get('/admin/Index/footer', 'Admin\IndexController@footer')->middleware('adminSession');





/***********订单管理模块***********/
// 生成订单处理
Route::post('/doOrder','Home\CartController@doOrder');
//支付商品
Route::post('/payMoney','Home\CartController@payMoney');
// 加载订单管页面
Route::get('admin/DetailController/index','Admin\DetailController@index');
// 加载详情订单
Route::get('admin/DetailController/detail/{id}','Admin\DetailController@detail');
// 处理发货
Route::get('admin/shipments/{id?}','Admin\DetailController@shipments')->where('id', '[A-Za-z]+');
// 处理退款
Route::get('admin/refund/{id?}','Admin\DetailController@refund');
// 加载订单修改页面
Route::get('admin/DetailController/change/{id?}','Admin\DetailController@change');
//订单修改处理
Route::post('/admin/DetailController/dochange', 'Admin\DetailController@doChange');\




//反馈信息页面
Route::get('admin/suggest/index','Admin\SuggestController@suggestMessage');





/***********管理员管理模块***********/
//加载添加管理员页面
Route::get('/admin/Administrator/create', 'Admin\AdministratorController@create');
//执行添加管理员
Route::post('/admin/Administrator/add', 'Admin\AdministratorController@add');

//加载管理列表页面
Route::get('/admin/Administrator/power', 'Admin\AdministratorController@power');
//加载修改权限页面
Route::get('/admin/Administrator/editPower/{id}', 'Admin\AdministratorController@editPower')->where('id', '[0-9]+');
//执行修改权限
Route::post('/admin/Administrator/updatePower', 'Admin\AdministratorController@updatePower');
//加载编辑管理员页面
Route::get('/admin/Administrator/edit/{id}', 'Admin\AdministratorController@edit')->where('id', '[0-9]+');
//执行编辑管理员信息
Route::post('/admin/Administrator/doEdit', 'Admin\AdministratorController@doEdit');
//加载角色管理页面
Route::get('/admin/Administrator/role', 'Admin\AdministratorController@role');
//加载添加角色页面
Route::get('/admin/Administrator/createRole', 'Admin\AdministratorController@createRole');
//执行添加角色
Route::post('/admin/Administrator/addRole', 'Admin\AdministratorController@addRole');
//加载编辑角色页面
Route::get('/admin/Administrator/editRole/{id}', 'Admin\AdministratorController@editRole')->where('id', '[0-9]+');
//执行编辑角色
Route::post('/admin/Administrator/updateRole', 'Admin\AdministratorController@updateRole');
//加载密码修改页面
Route::get('/admin/Administrator/editPass', 'Admin\AdministratorController@editPass');
//执行修改密码
Route::post('/admin/Administrator/updatePass', 'Admin\AdministratorController@updatePass');



/***********************************系统管理**************************/
//加载系统设置页面
Route::get('/admin/System/settings', 'Admin\SystemController@settings');
//保存系统设置
Route::post('/admin/System/saveSettings', 'Admin\SystemController@saveSettings');
//加载后台日志页面
Route::get('/admin/System/adminLogs', 'Admin\SystemController@adminLogs');
//加载前台日志页面
Route::get('/admin/System/homeLogs', 'Admin\SystemController@homeLogs');
//excel
Route::get('/admin/System/excel', 'Admin\SystemController@excel');
//加载友情链接
Route::get('/admin/System/link', 'Admin\SystemController@link');
//加载添加友情链接页面
Route::get('/admin/System/createLink', 'Admin\SystemController@createLink');
//执行添加友情链接
Route::post('/admin/System/addLink', 'Admin\SystemController@addLink');
//加载修改友情链接页面
Route::get('/admin/System/editLink/{id}', 'Admin\SystemController@editLink')->where('id', '[0-9]+');
//执行修改友情链接
Route::post('/admin/System/updateLink', 'Admin\SystemController@updateLink');
//执行删除友情链接
Route::post('/admin/System/delLink/{id}', 'Admin\SystemController@delLink')->where('id', '[0-9]+');


/***********************************用户页面**************************/
//加载用户页面(有问题找黄赠有)
Route::get('/admin/User/index', 'Admin\UserController@index');

//这是执行添加的路由
Route::get('/admin/User/create', 'Admin\UserController@create');

//这是添加页面提价过来的路由
Route::post('/admin/User/store', 'Admin\UserController@store');

//这是处理修改的功能 点击修改便加载到Admin\UserController@show
Route::get('/admin/User/show/{id}', 'Admin\UserController@show');

//这是show这么修改页面传过来的路由
Route::post('/admin/User/update/{id}', 'Admin\UserController@update');

//查看用户详情的路由
Route::get('/admin/User/detail/{id}', 'Admin\UserController@detail');

//加载用户删除页面
Route::get('/admin/User/delete/{id}','Admin\UserController@destroy')->where(['id'=>'\d+']);



/*****************************用户管理模块完成*************/
/*****************************商品分类模块（黄赠有）*****************/

//加载商品分类表(有问题找黄赠有)
Route::get('/admin/Type/index', 'Admin\TypeController@index');

//加载添加父分类页面
Route::get('/admin/Type/create', 'Admin\TypeController@create');

//这是添加父类别页面提交过来的路由
Route::post('/admin/Type/store', 'Admin\TypeController@store');

//这是处理修改的页面 点击修改便加载到Admin\UserController@show
Route::get('/admin/Type/show/{id}', 'Admin\TypeController@show');

Route::post('/admin/Type/update/{id}', 'Admin\TypeController@update');
//这是添加子分类 点击添加子分类的时候 该父类别会传ID过来
Route::get('/admin/Type/edit/{id}', 'Admin\TypeController@edit');

//这是处理添加子分类的方法 是我自己加上去的一个方法
Route::post('/admin/Type/smallstore/{id}','Admin\TypeController@smallstore');
//处理用户删除
Route::get('/admin/Type/delete/{id}','Admin\TypeController@destroy')->where(['id'=>'\d+']);



/*********************商品信息表（黄赠有）****************************/

Route::get('/admin/Goods/index','Admin\GoodsController@index');

//这是加载商品主图添加的路由
Route::get('/admin/Goods/create', 'Admin\GoodsController@create');

//商品信息表的删除功能
Route::get('/admin/Goods/delete/{id}','Admin\GoodsController@destroy')->where(['id'=>'\d+']);

//这是商品信息表添加页面提价过来的路由
Route::post('/admin/Goods/store','Admin\GoodsController@store');
//edit方法是点击编辑然后拿到的值
Route::get('/admin/Goods/edit/{id}', 'Admin\GoodsController@edit');

//update方法是处理修改功能的
Route::post('/admin/Goods/update/{id}','Admin\GoodsController@update');
/************************商品信息管理完成*************************/


/**********************开始商品价格管理shop_price（黄赠有）*************************/
//这是查看价格管理的表格
Route::get('/admin/Price/index','Admin\PriceController@index');
//这是添加价格管理的表格
Route::get('/admin/Price/create/{id}', 'Admin\PriceController@create');
//这是处理添加的路由
Route::post('/admin/Price/store', 'Admin\PriceController@store');

//edit方法是点击编辑然后拿到的值
Route::get('/admin/Price/edit/{id}', 'Admin\PriceController@edit');

//update方法是处理修改功能的
Route::post('/admin/Price/update/{id}','Admin\PriceController@update');

//这是执行删除的处理
Route::get('/admin/Price/delete/{id}','Admin\PriceController@destroy')->where(['id'=>'\d+']);


/****************************商品价格管理结束（黄赠有）*******************/


/***********************商品图片管理shop_pic(黄赠有)********************/

//这是查看价格管理的表格
Route::get('/admin/Pic/index','Admin\PicController@index');

//这是添加价格管理的表格
Route::get('/admin/Pic/create/{id}', 'Admin\PicController@create');

//这是处理添加的功能
Route::post('/admin/Pic/store', 'Admin\PicController@store');
//Route::post('/admin/Price/store', 'Admin\PriceController@store');

//edit方法是点击编辑然后拿到的值
Route::get('/admin/Pic/edit/{id}', 'Admin\PicController@edit');

//update方法是处理修改功能的
Route::post('/admin/Pic/update/{id}','Admin\PicController@update');

//这是执行删除的处理
Route::get('/admin/Pic/delete/{id}','Admin\PicController@destroy')->where(['id'=>'\d+']);


/****************************图片管理结束*****************************/

/*******************商品描述管理********/
//浏览商品描述表
Route::get('/admin/Text/index','Admin\TextController@index');
//执行删除处理
Route::get('/admin/Text/delete/{id}','Admin\TextController@destroy')->where(['id'=>'\d+']);
//加载添加页面
Route::get('/admin/Text/create/{id}', 'Admin\TextController@create');

//执行添加处理
Route::post('/admin/Text/store', 'Admin\TextController@store');

//edit方法是点击编辑然后拿到的值
Route::get('/admin/Text/edit/{id}', 'Admin\TextController@edit');

//update方法是处理修改功能的
Route::post('/admin/Text/update/{id}','Admin\TextController@update');


/***********结束商品描述管理*************/













//*****************************用户管理模块完成*******************************************/


/************积分管理************/

//积分订单表
Route::get('/admin/integralOrder/order', 'Admin\IntegralOrderController@order');

//进入修改订单页
Route::get('/admin/integralOrder/orderState/{id}', 'Admin\IntegralOrderController@orderState')->where('id', '[0-9]+');

//修改订单状态
Route::post('/admin/integralOrder/orderUpdate', 'Admin\IntegralOrderController@orderUpdate');



//积分商品表
Route::resource('admin/integral', 'Admin\IntegralController', ['only' => [
    'index', 'create', 'store', 'edit', 'update'
]]);

//添加积分商品页
Route::get('admin/integral/create', 'Admin\IntegralController@create');

//添加积分商品
Route::post('admin/integral/store', 'Admin\IntegralController@store');

//进入积分商品修改页面
Route::get('admin/integral/edit/{id}', 'Admin\IntegralController@edit')->where('id', '[0-9]+');

//修改积分商品
Route::post('admin/integral/update', 'Admin\IntegralController@update');

//删除积分商品
Route::get('admin/integral/destroy/{id}', 'Admin\IntegralController@destroy')->where('id', '[0-9]+');

//积分明细
Route::get('admin/integral/show/{id}', 'Admin\IntegralController@shows')->where('id', '[0-9]+');

/******************* 积分管理完成 *********************/

//导出Excel
Route::get('/admin/User/excel', 'Admin\UserController@excel');


//*****************************用户管理模块完成*******************************************//

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
